package com.cadre.system.service.impl;

import com.cadre.common.utils.oldutil.DateUtil;
import com.cadre.system.domain.officer.A19;
import com.cadre.system.domain.officer.ResumeInfo;
import com.cadre.system.mapper.A19Mapper;
import com.cadre.system.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service("resumeService")
public class ResumeServiceImpl implements ResumeService {
    @Autowired
    private A19Mapper a19Mapper;

    @Override
    public List<ResumeInfo> resumeMsg(String personid) {
        List<ResumeInfo> resumeInfos = new ArrayList<>();
        List<A19> a19s = this.a19Mapper.selectByPersonid(personid);
        if (a19s.size() != 0) {
            for (int i = 0; i < a19s.size(); i++) {
                ResumeInfo resumeInfo = new ResumeInfo();
                resumeInfo.setFlowid(a19s.get(i).getFlowid());
                resumeInfo.setPersonid(a19s.get(i).getPersonid());
                resumeInfo.setA1905(DateUtil.dateToStr(a19s.get(i).getA1905()));
                resumeInfo.setA1910(DateUtil.dateToStr(a19s.get(i).getA1910()));
                resumeInfo.setA1955(a19s.get(i).getA1955());
                resumeInfos.add(resumeInfo);
            }
        } else {
            System.out.println("--------------A19  null----------------");
        }
        return resumeInfos;
    }
}
